<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>登录页面</title>
<link rel="shortcut icon" href="images/zk.ico" type="image/x-icon" />
<link rel="stylesheet" href="lib/layui/css/layui.css">
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript">


</script>

<style type="text/css">
#login {
	height: 400px;
	width: 300px;
	margin: 100px auto;
	z-index: 2;
	position: absolute;
	top: 25%;
	left: 20%;
}
img
{
opacity:0.8;
filter:alpha(opacity=40); 
}

#btn {
	left: 100px;
}

#back {
	height: 100%;
	width: 100%;
	/* background-image:url("image/a2.jpg"); */
	background-repeat: round;
	background-origin: content-box;
	z-index: 1;
}
#h{
   color: Aqua;
}
#h1{
  color:red;
}
#msg1,#msg2{
	color:red;
}
</style>
<script type="text/javascript">
	//提交事件
	/* function isubmit() {
		$("#btnsubmit").click();
	} */
	
/* 	$(function() {
	
	}) */
	function myCheck() {
		var  flag = true;
		var p1 = document.getElementById("ename");
		var p2 = document.getElementById("pwd");
		console.log("p1val======="+p1.value);
		console.log("p2val======="+p2.value);
		console.log("p1len======="+p1.value.length);
		console.log("p2len======="+p2.value.length);
		// 用户名 判断  p1.value == ""		p1.value.length != 0
		if(p2.value.length != 0 && p2.value != ""){
			document.getElementById("msg2").innerHTML = ""; 
		}
		if(p1.value.length != 0 && p1.value != ""){
			document.getElementById("msg1").innerHTML = ""; 
		}
		if (p1.value.length == 0 && p1.value == "") {
			document.getElementById("msg1").innerHTML = "请输入用户名";
			flag = false;
			return flag;
		}else{
			document.getElementById("msg1").innerHTML = "";
			flag = true;
		}
		// 密码 框 判断
		if(p2.value.length == 0 && p2.value == ""){
			document.getElementById("msg2").innerHTML = "请输入密码"; 
			flag = false;
			return flag;
		}else{
			document.getElementById("msg2").innerHTML = "";
			flag = true;
		}
		if (p1.value.length == 0 && p1.value == "" || p2.value.length == 0 && p2.value == "") {
			flag = false;
		}
		console.log("flag:::"+flag)
	 	return flag;
	}
</script>
</head>
<body>
	<div id="back">
		<img alt="" src="image/a2.jpg" style="width: 100%; height: 1000px;">
	</div>
	<div id="login">
	     <h3 id="h1">${msg}</h3>
		<h1 id="h">用户登录</h1><!-- target="_bank"  -->
		<form action="login.do" method="post"  onsubmit="return myCheck()">
			<input type="text" name="ename" id = "ename" class="form-control"><span id = "msg1"></span><br>
			<input type="password" name="pwd" id = "pwd" class="form-control"><span id = "msg2"></span><br>
			<button id="btnsubmit" class="btn btn-primary pull-left facebook" type="submit" >登录</button><!-- style="display: none;" -->
		</form>

		<div class="social-login clearfix">
			<!-- <a class="btn btn-primary pull-left facebook" onclick="isubmit()">登录</a> -->
			<!-- <a id="btn"    class="btn btn-primary pull-left facebook" href="registy.jsp">注册</a> -->
		</div>
	</div>

</body>
</html>